﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Thallo {
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public sealed class CachedableAttribute : Attribute {

        public CachedableAttribute() {
            Mode = UpdateMode.Normal;
        }

        public int ExpirationTime { get; set; }

        public UpdateMode Mode{ get; set; }

        public Type MethodHandlerType {
            get;
            set;
        }

        public string DependencyGroup { get; set; }

    }


    public sealed class DependencyAttribute : Attribute {

        public DependencyAttribute(Type type, string methodName) {
            this.Type = type;
            this.MethodName = methodName;
        }

        internal DependencyAttribute(string typeName, string methodName) {
            if (!string.IsNullOrEmpty(typeName))
                this.Type = System.Type.GetType(typeName);
            this.MethodName = methodName;
        }

        internal Type Type { get; set; }

        public string MethodName { get; set; }

        public Type MethodHandlerType { get; set; }
    }




}
